Kanzi 4.0.0-beta2
kanzi::DebugRenderRegistry Class Reference

Use the debug render registry to register debug rendering functions for your custom Node3D nodes. More...

#include <kanzi/core.ui/node/debug_render_registry.hpp>

Classes

class  DebugRenderStorage
 Storage class for storing visualizations used with debug rendering. More...
 

Public Types

using DebugObjectRenderingFunction
 Debug object rendering function pointer.
 
using FunctionMap
 Type for the debug function map.
 

Public Member Functions

void addMapping (const Metaclass *metaclass, DebugObjectRenderingFunction function)
 Adds a mapping from the metaclass to the function that you want to use to render the debug visualization.
 
DebugObjectRenderingFunction getRenderingFunction (const Metaclass *metaclass) const
 Gets the debug rendering function of a given metaclass.
 

Protected Attributes

FunctionMap m_functionMapping
 Function mapping.
 

Detailed Description

Use the debug render registry to register debug rendering functions for your custom Node3D nodes.

The central registry allows the Kanzi Studio Preview and Kanzi Engine plugins to register these functions.

For your custom node type, use a debug rendering function to draw information that is helpful to you during development. For example, for the Camera node, the debug rendering function draws a wireframe visualization that displays the orientation of the camera. To see the debug visualizations in the Kanzi Studio Preview, enable the Analyze mode.

To register the debug rendering functions for your plugin module, use Module::registerDebugRenderingFunctions.

The debug rendering function is of the form:

void (*)(Renderer& renderer, DebugRenderStorage&, DebugVisualization*, NodeSharedPtr)

Here, the storage and visualization allow the user to cache data related to the debug rendering of the node. If the debug visualization is used, it must be created and added to the storage by calling DebugRenderStorage::emplace(). The user may omit using this feature, to achieve this, do not create a debug visualization (in this case, the visualization parameter will always be nullptr).

Member Typedef Documentation

◆ DebugObjectRenderingFunction

Debug object rendering function pointer.

Parameters
rendererRenderer to use.
storageDebug rendering storage.
visualizationPreviously created debug visualization or nullptr.
objectObject being rendered.
Since
Kanzi 4.0.0
  • Added the storage and visualization parameters.
  • Changed the type of the renderer parameter to Renderer&.

◆ FunctionMap

Type for the debug function map.

Member Function Documentation

◆ addMapping()

void kanzi::DebugRenderRegistry::addMapping ( const Metaclass * metaclass,
DebugObjectRenderingFunction function )

Adds a mapping from the metaclass to the function that you want to use to render the debug visualization.

Parameters
metaclassMetaclass to register.
functionThe function to use to render the debug visualization for the nodes of a given metaclass.

◆ getRenderingFunction()

DebugObjectRenderingFunction kanzi::DebugRenderRegistry::getRenderingFunction ( const Metaclass * metaclass) const

Gets the debug rendering function of a given metaclass.

Parameters
metaclassThe Metaclass for which to get the debug rendering function.
Returns
The debug rendering function. If the metaclass has no debug rendering function, returns nullptr.

Member Data Documentation

◆ m_functionMapping

FunctionMap kanzi::DebugRenderRegistry::m_functionMapping
protected

Function mapping.


The documentation for this class was generated from the following file: